#include "struct.h"
#include "function.h"

/**
 * @brief 得到书籍的信息
 * 
 * @return Book 返回书籍结构体的变量
 */

Book inputbook_func()
{
    Book book;
    printf("请输入书名：");
    //clear_char();           //清除scanf遗留的缓存
    //fgets(book.title, sizeof(book.title), stdin);
    scanf("%s", book.title);

    printf("请输入作者：");
    scanf("%s", book.author);

    printf("请输入ISBN：");
    scanf("%s", book.isbn);

    printf("请输入出版社：");
    scanf("%s", book.publisher);

    printf("请输入年份：");
    scanf("%d", &book.year);

    printf("请输入库存：");
    scanf("%d", &book.stock);

    printf("请输入已借出数量：");
    scanf("%d", &book.borrowed);

    return book;
}